{% load i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
	<title>{{ member.username }} - Blog</title>
	<link rel="stylesheet" type="text/css" href="/senbzblog/templates/themes/{{ blog.theme }}/static/css/base.css">

	<script type="text/javascript" src="/senbzblog/static/js/jquery-1.2.6.js"></script>
	
	<script type="text/javascript" src="/static/js/base.js"></script>
	<script type="text/javascript" src="/static/js/utils.js"></script>
	<script type="text/javascript" src="/static/js/comments.js"></script>
	<script type="text/javascript" src="/static/js/validator.js"></script>
	<script type="text/javascript" src="/static/js/operation.js"></script>
	<script type="text/javascript" src="/static/js/cookie.js"></script>
	{% block header %}{% endblock %}
	<script type="text/javascript">
	$(document).ready(function(){
		senbz.init_sidebar();
	});
	</script>
</head>
<body>
	<div id="header">
	  	<h1><a href='{{ blog.get_absolute_url }}'>{{ blog.title }}</a></h1>
  		<ul>
		  <li><a href="{{ blog.get_absolute_url }}">{% trans "Home" %}</a></li>
		  <li><a href="{{ blog.get_show_articles_url }}">{% trans "Blog" %}</a></li>
		  {% for page in pages %}
		  <li><a href="{{ page.get_absolute_url }}">{{ page.title }}</a></li>
		  {% endfor %}
		</ul>
	  	<div id="search">
	  		<form action="#">
	  			<input type="text" name="q" id="txtSearch">
	  			<input type="submit" name="search" value="{% trans 'Search' %}">
	  		</form>
	  	</div>
	</div>
	<div id="top-nav">
		<ul id="ulTopNav">
			{% for category in blog.get_root_categories %}
			<li>
				<a href="{{ category.get_show_category_url }}"
				class="{% ifequal category.id root_category %}active{% endifequal %} {% if category.has_children %}has_children{% endif %}">
				{{ category.title }}</a>
				{% if category.has_children %}
				<ul>
					{% for sub in category.children.all %}
					<li><a href="{{ sub.get_show_category_url }}"
						{% ifequal sub.id current_category %}class="subactive"{% endifequal %}>
						{{ sub.title }}</a>
					</li>
					{% endfor %}
				</ul>
				{% endif %}
			</li>
			{% endfor %}
		</ul>
	</div>
	<div id="body" class="colmask blogstyle">
		<div class="colmid">
			<div class="colleft">
				<div class="col1">
					<div id="divTop">
						
					</div>
					{% block col1 %}{% endblock %}
				</div>
				<div class="col4">
					{% block col4 %}{% endblock %}
				</div>
				<div class="col2">
					{% block col2 %}{% endblock %}
				</div>
				<div onclick="senbz.hide_sidebar();" class="hideSidebar"></div>
				<div class="col3">
					<h2>{% trans "Recent Articles" %}</h2>
					<ol>
					{% for article in blog.get_recent_articles %}
					  <li><a href="{{ article.get_absolute_url }}" 
					  		title="{{ article.title }} on {{ article.created_date|date:'Y-m-d H:i' }}">
					  	{{ article.title }}</a></li>
					{% endfor %}
					</ol>
					
					<h2>{% trans "Article ranking" %}</h2>
					<ol>
					{% for article in blog.get_ranking_articles %}
					  <li><a href="{{ article.get_absolute_url }}" title="{{ article.title }} {{ article.browse }}">
					  	{{ article.title }}</a></li>
					{% endfor %}
					</ol>
					
					<h2>{% trans "Links" %}</h2>
					<ul>
						{% for link in blog.get_links|slice:":5" %}
						<li><a target="_blank" href="{{ link.link_url }}">{{ link.title }}</a></li>
						{% endfor %}
					</ul>
					
					<h2>{% trans "Tag cloud" %}</h2>
					<div class="tags">
						{% for tag in tags %}
						<a href="{% url show_tag member.username, tag.id %}"
							title="{{ tag }} {{ tag.get_article_count }}">
						{{ tag }}
						</a>
						{% endfor %}
					</div>
				</div>
				<div style="clear: both"></div>
			</div>
		</div>
	</div>
	<div id="footer">
	  	<p>
		    Copyright © 2011 Yang Wanjun.  All rights reserved.
		    <a class="alignright" href="/admin/{{ member.username }}">Admin</a>
			{% if user.is_authenticated %}
			<a class="alignright" href="{% url user_logout %}">{% trans "Log out" %}</a>
			{% else %}
			<a class="alignright" href="{% url user_register %}">{% trans "Register" %}</a>
			<a class="alignright" href="{% url user_login %}?next={{ request.path }}">{% trans "Log in" %}</a>
			{% endif %}
	  	</p>
	</div>
</body>
</html>